import pytest
from errors import Missing
from model.explorer import Explorer
from service import explorer as code

sample = Explorer(
    name="Claude Hande",
    country="FR",
    description="Scarce during full moons",
)


def test_create():
    resp = code.create(sample)
    assert resp == sample


def test_get_exists():
    resp = code.get_one("Claude Hande")
    assert resp == sample


def test_get_missing():
    with pytest.raises(Missing):
        code.get_one("Hazadus")
